﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace IkeCode.WP7.Toolkit.Persist
{
    /// <summary>
    /// Settings to Persist
    /// </summary>
    public class IcSmartPersistSettings
    {
        private string _appStatePrefix;
        /// <summary>
        /// AppState prefix name
        /// Default - ic_
        /// </summary>
        public string AppStatePrefix
        {
            get { return string.IsNullOrWhiteSpace(_appStatePrefix) ? "ic_" : _appStatePrefix; }
            set
            {
                if (_appStatePrefix == value)
                    return;
                _appStatePrefix = value;
            }
        }

        private string _imagesCacheFolderName;
        /// <summary>
        /// Images cache folder name
        /// Default - imgs
        /// </summary>
        public string ImagesCacheFolderName
        {
            get { return string.IsNullOrWhiteSpace(_imagesCacheFolderName) ? "imgs" : _imagesCacheFolderName; }
            set
            {
                if (_imagesCacheFolderName == value)
                    return;
                _imagesCacheFolderName = value;
            }
        }

        private int _maxAttemptsToAccessISF = 3;
        /// <summary>
        /// Max attempts to access objects in Isolated Storage, don't accepts values less than 3. 
        /// Default - 3
        /// </summary>
        public int MaxAttemptsToAccessISF
        {
            get { return _maxAttemptsToAccessISF; }
            set
            {
                if (_maxAttemptsToAccessISF == value || _maxAttemptsToAccessISF < 3)
                    return;
                _maxAttemptsToAccessISF = value;
            }
        }

        private bool _sendMvvmLightMessage;
        /// <summary>
        /// Determine if that service will send MVVM Light Message with objects on restore all objects to cache
        /// <para>
        /// Make sure that you reference in your project the Galasoft.MvvmLight
        /// </para>
        /// </summary>
        private bool SendMvvmLightMessage
        {
            get { return _sendMvvmLightMessage; }
            set
            {
                if (_sendMvvmLightMessage == value)
                    return;
                _sendMvvmLightMessage = value;
            }
        }
    }
}
